//
//  UIView+AWTheme.m
//  changeShin
//
//  Created by Alan Wang on 2019/3/25.
//  Copyright © 2019 Alan Wang. All rights reserved.
//

#import "UIView+AWTheme.h"
#import "NSObject+AWTheme.h"
#import "AWThemeManager.h"

@implementation UIView (AWTheme)

-(void)AWTheme_BackgroundColorForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.backgroundColor = [[AWThemeManager shareInstance] colorForKey:key];
    } forKey:@"backgroundColor"];
}

//透明度
-(void)AWTheme_AlphaForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.alpha = [[AWThemeManager shareInstance] floatForKey:key];
    } forKey:@"alpha"];
}
//tintColor
-(void)AWTheme_TintColorForKey:(NSString*)key{
    AWweakify(self)
    [self saveBlok:^{
        AWstrongify(self)
        self.tintColor = [[AWThemeManager shareInstance] colorForKey:key];
    } forKey:@"tintColor"];
}
@end
